Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

matcher-collection

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

matcher-collection

Minimatch but for collections of minimatcher matchers.

  • 1.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
decreased by-6.69%
Maintainers
1
Weekly downloads
 
Created

What is matcher-collection?

The matcher-collection npm package is a utility that allows you to efficiently test if a value matches any of a collection of patterns. It is often used to filter or find items in a list that match certain criteria.

What are matcher-collection's main functionalities?

Matching strings against patterns

This feature allows you to create a collection of string patterns and then test if a given string matches any of those patterns. The patterns can include wildcards.

"use strict";
const MatcherCollection = require('matcher-collection');
let matchers = new MatcherCollection(['foo*', 'bar']);
console.log(matchers.match('foobar')); // true
console.log(matchers.match('barbaz')); // true
console.log(matchers.match('qux')); // false

Matching with regular expressions

Matcher-collection can also handle regular expressions, allowing for more complex matching scenarios.

"use strict";
const MatcherCollection = require('matcher-collection');
let matchers = new MatcherCollection([/foo/, 'bar']);
console.log(matchers.match('foobar')); // true
console.log(matchers.match('barbaz')); // true
console.log(matchers.match('quxfoo')); // true
console.log(matchers.match('qux')); // false

Other packages similar to matcher-collection

FAQs

Package last updated on 04 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc